package cn.livingCloud.dto;

import cn.livingCloud.entity.system.ImageResource;

import java.util.List;

/**
 * Created by 唐旭 on 2016/1/28.
 */
public class ImageListDto extends Page<ImageDto> {
    private int start;
    private int size;
    private String name;
    private String extName;

    private String state = "SUCCESS";
    private long total;
    private boolean archive = false;
    private String startTime;
    private String endTime;

    public ImageListDto() {
    }

    @Override
    public void addAllList(List itemList) {
        for (Object o : itemList) {
            ImageResource resource = (ImageResource) o;
            list.add(new ImageDto(resource.getUuid()));
        }
    }

    @Override
    public void setTotalPage(long totalCount) {
        super.setTotalPage(totalCount);
        this.total = super.totalRecord;
    }

    public String getName() {
        return name;
    }

    public ImageListDto setName(String name) {
        this.name = name;
        return this;
    }

    public String getExtName() {
        return extName;
    }

    public ImageListDto setExtName(String extName) {
        this.extName = extName;
        return this;
    }

    public int getStart() {
        return start;
    }

    public ImageListDto setStart(int start) {
        this.start = start;
        this.currentPage = start / size + 1;
        return this;
    }

    public int getSize() {
        return size;
    }

    public ImageListDto setSize(int size) {
        this.size = size;
        this.rowSize = size;
        return this;
    }

    public String getState() {
        return state;
    }

    public ImageListDto setState(String state) {
        this.state = state;
        return this;
    }

    public long getTotal() {
        return total;
    }

    public ImageListDto setTotal(long total) {
        this.total = total;
        return this;
    }

    public boolean isArchive() {
        return archive;
    }

    public ImageListDto setArchive(boolean archive) {
        this.archive = archive;
        return this;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
}
